#ifndef MAINWINDOW_H
#define MAINWINDOW_H
 
#include <QWidget>
#include "droparea.h"
#include "graphwin.h"

class CloseButton : public QLabel
{
  Q_OBJECT
	
 public:
  CloseButton(QWidget* parent, int x, int y);
	
 protected:
  void enterEvent(QEvent *event);
  void leaveEvent(QEvent *event);
	
};

class MainWindow : public QWidget
{
  Q_OBJECT
	
 public:
  MainWindow();
  bool loadFile(const QFileInfo &fi);
  void unload();
	
 protected:
  void paintEvent(QPaintEvent *);
  void resizeEvent(QResizeEvent *event);
  void mousePressEvent(QMouseEvent *event);
  void mouseMoveEvent(QMouseEvent *event);
  void mouseReleaseEvent(QMouseEvent *event);
  void keyPressEvent(QKeyEvent *event);
		
 private:
  void createLayout();
  //void loadFile(const QString &fileName);
		
  bool inButton;
  bool quitting;
  QPixmap *pixmap;
  QPoint dragPosition;
  DropArea *dropArea;
  QRegion *exitButton;
  CloseButton *exitLabel;

  GraphWin *graphwin;
		
  DataHRM *openData;
  QString openDesc;
	
};

#endif
